#include "SpaceShooterMenuButtons.h"
#include "SpaceShooterClient.h"
////////////////////////////////////////////////
// Button_EnergyReserves
//
// Update: gets the current energy reserves
// Render: renders the energy value
// Mouseover: Nothing
// Click: Nothing
// Activates on: Nothing
// Deactivates on: Nothing
// Darkens on: Nothing
// Highlights on: Nothing
///////////////////////////////////////////////
Button_EnergyReserves::Button_EnergyReserves(SpaceShooterClient* game, ButtonType id, float xLeft, float xRight, float yTop, float yBottom, int w, int h, LPCSTR texLit, LPCSTR texUnlit, ID3DXSprite* sprite, ID3DXFont* font)
	: MenuButton(id, xLeft, xRight, yTop, yBottom, w, h,texLit, texUnlit, sprite, font)
{
	mGame = game;
	Darken();
}

Button_EnergyReserves::~Button_EnergyReserves(void)
{
	// nothing special
}

bool Button_EnergyReserves::Update(POINT mousepos, bool buttonDown)
{
	sprintf_s(mTextBuffer, "Energy Reserves\n%i", mGame->GetPlayerInfo().energyReserve);

	return IsMouseOver(mousepos);
}

////////////////////////////////////////////////
// Button_BlasterEnergy
//
// Update: Gets the current blaster energy value
// Render: Renders the energy value
// Mouseover: Nothing
// Click: Nothing
// Deactivates on: Nothing
// Activates on: Nothing
// Darkens on: Nothing
// Highlights on: Nothing
///////////////////////////////////////////////
Button_BlasterEnergy::Button_BlasterEnergy(SpaceShooterClient* game, ButtonType id, float xLeft, float xRight, float yTop, float yBottom, int w, int h, LPCSTR texLit, LPCSTR texUnlit, ID3DXSprite* sprite, ID3DXFont* font)
	: MenuButton(id, xLeft, xRight, yTop, yBottom, w, h,texLit, texUnlit, sprite, font)
{
	mGame = game;
}

Button_BlasterEnergy::~Button_BlasterEnergy(void)
{

}

bool Button_BlasterEnergy::Update(POINT mousepos, bool buttonDown)
{
	PlayerInformation info = mGame->GetPlayerInfo();

	// if repairs need to be completed
	if (info.turnsUntilRepairBlaster > 0)
	{
		// update the text
		sprintf_s(mTextBuffer, "BLASTERS DAMAGED\n%i turns", info.turnsUntilRepairBlaster);
	}
	else// no repairs are needed
	{
		// update the text
		sprintf_s(mTextBuffer, "Blaster Energy\n%i", info.blasterEnergy);
	}

	return IsMouseOver(mousepos);
}

////////////////////////////////////////////////
// Button_ShieldEnergy
//
// Update: Gets the current shield energy value
// Render: renders the energy value
// Mouseover: Nothing
// Click: Nothing
// Activate: Nothing
// Deactivate: Nothing
// Darkens on: Damaged shields
// Highlights on: Repaired shields
///////////////////////////////////////////////
Button_ShieldEnergy::Button_ShieldEnergy(SpaceShooterClient* game, ButtonType id, float xLeft, float xRight, float yTop, float yBottom, int w, int h, LPCSTR texLit, LPCSTR texUnlit, ID3DXSprite* sprite, ID3DXFont* font)
	: MenuButton(id, xLeft, xRight, yTop, yBottom, w, h,texLit, texUnlit, sprite, font)
{
	mGame = game;
	Darken();
}

Button_ShieldEnergy::~Button_ShieldEnergy(void)
{

}

bool Button_ShieldEnergy::Update(POINT mousepos, bool buttonDown)
{
	PlayerInformation info = mGame->GetPlayerInfo();

	// if repairs need to be completed
	if (info.turnsUntilRepairShields > 0)
	{
		// update the text
		sprintf_s(mTextBuffer, "SHIELDS DAMAGED\n%i turns", info.turnsUntilRepairShields);
	}
	else// no repairs are needed
	{
		// update the text
		sprintf_s(mTextBuffer, "Shield Energy\n%i", info.shieldEnergy);
	}

	return IsMouseOver(mousepos);
}

////////////////////////////////////////////////
// Button_IncreaseBlasters
//
// Update: Nothing
// Render: Renders a "+"
// Mouseover: Highlights button
// Click: Sends message to client to increase blasters (which sends message to server)
// Activates on: Repaired blasters
// Deactivates on: Damaged blasters
// Darkens on: no mouseover
// Highlights on: mouseover
///////////////////////////////////////////////
Button_IncreaseBlasters::Button_IncreaseBlasters(SpaceShooterClient* game, ButtonType id, float xLeft, float xRight, float yTop, float yBottom, int w, int h, LPCSTR texLit, LPCSTR texUnlit, ID3DXSprite* sprite, ID3DXFont* font)
	: MenuButton(id, xLeft, xRight, yTop, yBottom, w, h,texLit, texUnlit, sprite, font)
{
	mGame = game;
	sprintf_s(mTextBuffer, "Incr");
}

Button_IncreaseBlasters::~Button_IncreaseBlasters(void)
{

}

bool Button_IncreaseBlasters::Update(POINT mousepos, bool buttonDown)
{
	bool retval = false;

	PlayerInformation info = mGame->GetPlayerInfo();

	if (info.turnsUntilRepairBlaster > 0)
	{
		if (mActivated)
		{
			Deactivate();
		}
	}

	if (info.turnsUntilRepairBlaster <= 0)
	{
		if (!mActivated)
		{
			Activate();
		}
	}

	if (IsMouseOver(mousepos))
	{
		retval = true;
		if (buttonDown)
		{
			mGame->Event(MSGTYPE_INPUT_INCREASE_BLASTERS);
			
		}
		if (!mHighlighted)
			Highlight();
	}
	else
	{
		if (mHighlighted)
			Darken();
	}	
	return retval;

}


////////////////////////////////////////////////
// Button_DecreaseBlasters
//
// Update: Nothing
// Render: Renders a "-"
// Mouseover: Highlights button
// Click: Sends message to client to decrease blasters (which sends message to server)
// Activates on: Repaired blasters
// Deactivates on: Damaged blasters
// Darkens on: no mouseover
// Highlights on: mouseover
///////////////////////////////////////////////
Button_DecreaseBlasters::Button_DecreaseBlasters(SpaceShooterClient* game, ButtonType id, float xLeft, float xRight, float yTop, float yBottom, int w, int h, LPCSTR texLit, LPCSTR texUnlit, ID3DXSprite* sprite, ID3DXFont* font)
	: MenuButton(id, xLeft, xRight, yTop, yBottom, w, h,texLit, texUnlit, sprite, font)
{
	mGame = game;
	sprintf_s(mTextBuffer, "Decr");
}

Button_DecreaseBlasters::~Button_DecreaseBlasters(void)
{

}

bool Button_DecreaseBlasters::Update(POINT mousepos, bool buttonDown)
{
	
	bool retval = false;

	PlayerInformation info = mGame->GetPlayerInfo();

	if (info.turnsUntilRepairBlaster > 0)
	{
		if (mActivated)
		{
			Deactivate();
		}
	}

	if (info.turnsUntilRepairBlaster <= 0)
	{
		if (!mActivated)
		{
			Activate();
		}
	}

	if (IsMouseOver(mousepos))
	{
		retval = true;
		if (buttonDown)
		{
			mGame->Event(MSGTYPE_INPUT_DECREASE_BLASTERS);
			
		}
		if (!mHighlighted)
			Highlight();
	}
	else
	{
		if (mHighlighted)
			Darken();
	}	
	return retval;
}

////////////////////////////////////////////////
// Button_IncreaseShields
//
// Update: Nothing
// Render: Renders a "+"
// Mouseover: Highlights button
// Click: Sends message to client to increase Shields (which sends message to server)
// Activates on: Repaired Shields
// Deactivates on: Damaged Shields
// Darkens on: no mouseover
// Highlights on: mouseover
///////////////////////////////////////////////
Button_IncreaseShields::Button_IncreaseShields(SpaceShooterClient* game, ButtonType id, float xLeft, float xRight, float yTop, float yBottom, int w, int h, LPCSTR texLit, LPCSTR texUnlit, ID3DXSprite* sprite, ID3DXFont* font)
	: MenuButton(id, xLeft, xRight, yTop, yBottom, w, h,texLit, texUnlit, sprite, font)
{
	mGame = game;
	sprintf_s(mTextBuffer, "Incr");
}

Button_IncreaseShields::~Button_IncreaseShields(void)
{

}

bool Button_IncreaseShields::Update(POINT mousepos, bool buttonDown)
{
	bool retval = false;

	PlayerInformation info = mGame->GetPlayerInfo();

	if (info.turnsUntilRepairShields > 0)
	{
		if (mActivated)
		{
			Deactivate();
		}
	}

	if (info.turnsUntilRepairShields <= 0)
	{
		if (!mActivated)
		{
			Activate();
		}
	}

	if (IsMouseOver(mousepos))
	{
		retval = true;
		if (buttonDown)
		{
			mGame->Event(MSGTYPE_INPUT_INCREASE_SHIELDS);
			
		}
		if (!mHighlighted)
			Highlight();
	}
	else
	{
		if (mHighlighted)
			Darken();
	}	
	return retval;
}


////////////////////////////////////////////////
// Button_DecreaseShields
//
// Update: Nothing
// Render: Renders a "-"
// Mouseover: Highlights button
// Click: Sends message to client to decrease Shields (which sends message to server)
// Activates on: Repaired Shields
// Deactivates on: Damaged Shields
// Darkens on: no mouseover
// Highlights on: mouseover
///////////////////////////////////////////////
Button_DecreaseShields::Button_DecreaseShields(SpaceShooterClient* game, ButtonType id, float xLeft, float xRight, float yTop, float yBottom, int w, int h, LPCSTR texLit, LPCSTR texUnlit, ID3DXSprite* sprite, ID3DXFont* font)
	: MenuButton(id, xLeft, xRight, yTop, yBottom, w, h,texLit, texUnlit, sprite, font)
{
	mGame = game;
	sprintf_s(mTextBuffer, "Decr");
}

Button_DecreaseShields::~Button_DecreaseShields(void)
{

}

bool Button_DecreaseShields::Update(POINT mousepos, bool buttonDown)
{
	bool retval = false;

	PlayerInformation info = mGame->GetPlayerInfo();

	if (info.turnsUntilRepairShields > 0)
	{
		if (mActivated)
		{
			Deactivate();
		}
	}

	if (info.turnsUntilRepairShields <= 0)
	{
		if (!mActivated)
		{
			Activate();
		}
	}

	if (IsMouseOver(mousepos))
	{
		retval = true;
		if (buttonDown)
		{
			mGame->Event(MSGTYPE_INPUT_DECREASE_SHIELDS);
			
		}

		if (!mHighlighted)
		{
			Highlight();
		}
	}
	else
	{
		if (mHighlighted)
		{
			Darken();
		}
	}	

	return retval;
}

////////////////////////////////////////////////
// Button_MissilesRemaining
//
// Update: Gets the current shield energy value
// Render: renders the energy value
// Mouseover: Nothing
// Click: Nothing
// Activate: Nothing
// Deactivate: Nothing
// Darkens on: Damaged shields
// Highlights on: Repaired shields
///////////////////////////////////////////////
Button_MissilesRemaining::Button_MissilesRemaining(SpaceShooterClient* game, ButtonType id, float xLeft, float xRight, float yTop, float yBottom, int w, int h, LPCSTR texLit, LPCSTR texUnlit, ID3DXSprite* sprite, ID3DXFont* font)
	: MenuButton(id, xLeft, xRight, yTop, yBottom, w, h,texLit, texUnlit, sprite, font)
{
	mGame = game;
	Darken();
}

Button_MissilesRemaining::~Button_MissilesRemaining(void)
{

}

bool Button_MissilesRemaining::Update(POINT mousepos, bool buttonDown)
{
	PlayerInformation info = mGame->GetPlayerInfo();

	// if repairs need to be completed
	if (info.turnsUntilRepairMissiles > 0)
	{
		// update the text
		sprintf_s(mTextBuffer, "MISSILES DAMAGED\n%i turns", info.turnsUntilRepairMissiles);
	}
	else// no repairs are needed
	{
		// update the text

		sprintf_s(mTextBuffer, "Missiles\n%i", info.missilesRemaining);
	}

	return IsMouseOver(mousepos);
}

////////////////////////////////////////////////
// Button_TurnsRemaining
//
// Update: Gets the current shield energy value
// Render: renders the energy value
// Mouseover: Nothing
// Click: Nothing
// Activate: Nothing
// Deactivate: Nothing
// Darkens on: Damaged shields
// Highlights on: Repaired shields
///////////////////////////////////////////////
Button_TurnsRemaining::Button_TurnsRemaining(SpaceShooterClient* game, ButtonType id, float xLeft, float xRight, float yTop, float yBottom, int w, int h, LPCSTR texLit, LPCSTR texUnlit, ID3DXSprite* sprite, ID3DXFont* font)
	: MenuButton(id, xLeft, xRight, yTop, yBottom, w, h,texLit, texUnlit, sprite, font)
{
	mGame = game;
	Darken();
}

Button_TurnsRemaining::~Button_TurnsRemaining(void)
{

}

bool Button_TurnsRemaining::Update(POINT mousepos, bool buttonDown)
{
	sprintf_s(mTextBuffer, "Turns\n%i", mGame->GetPlayerInfo().turn);
	return IsMouseOver(mousepos);
}

////////////////////////////////////////////////
// Button_Docked
//
// Update: Nothing
// Render: Renders text notifying the player that they are docked, and they should click to undock
// Mouseover: Highlights button (if active)
// Click: Sends message to client to undock (if active)
// Activates on: Docked
// Deactivates on: Undocked
// Darkens on: No mouseover
// Highlights on: Mouseover
///////////////////////////////////////////////
Button_Docked::Button_Docked(SpaceShooterClient* game, ButtonType id, float xLeft, float xRight, float yTop, float yBottom, int w, int h, LPCSTR texLit, LPCSTR texUnlit, ID3DXSprite* sprite, ID3DXFont* font)
	: MenuButton(id, xLeft, xRight, yTop, yBottom, w, h,texLit, texUnlit, sprite, font)
{
	mGame = game;
	sprintf_s(mTextBuffer, "Docked\nClick to Undock");
}

Button_Docked::~Button_Docked(void)
{

}

bool Button_Docked::Update(POINT mousepos, bool buttonDown)
{
	bool retval = false;
	if (mGame->GetPlayerInfo().docked)
	{
		if (!mActivated)
		{
			Activate();
		}
		else
		{
			if (IsMouseOver(mousepos))
			{
				retval = true;
				if (!mHighlighted)
				{
					Highlight();
				}

				if (buttonDown)
				{
					mGame->Event(MSGTYPE_INPUT_UNDOCK);
				}
			}
			else
			{
				if (mHighlighted)
				{
					Darken();
				}
			}
		}
	}
	else
	{
		if (mActivated)
		{
			Deactivate();
		}
	}
	return retval;
}


////////////////////////////////////////////////
// Button_RestartGame
//
// Update: Nothing
// Render: Renders text to restart game
// Mouseover: Highlights button
// Click: Sends message to client to restart game
// Activates on: Nothing
// Deactivates on: Nothing
// Darkens on: No mouseover
// Highlights on: Mouseover
///////////////////////////////////////////////
Button_RestartGame::Button_RestartGame(SpaceShooterClient* game, ButtonType id, float xLeft, float xRight, float yTop, float yBottom, int w, int h, LPCSTR texLit, LPCSTR texUnlit, ID3DXSprite* sprite, ID3DXFont* font)
	: MenuButton(id, xLeft, xRight, yTop, yBottom, w, h,texLit, texUnlit, sprite, font)
{
	mGame = game;
	sprintf_s(mTextBuffer, "Restart Game");
}

Button_RestartGame::~Button_RestartGame(void)
{

}

bool Button_RestartGame::Update(POINT mousepos, bool buttonDown)
{
	bool retval = false;
	if (IsMouseOver(mousepos))
	{
		retval = true;
		if (!mHighlighted)
		{
			Highlight();
		}

		if (buttonDown)
		{
			mGame->Event(MSGTYPE_INPUT_RESTART);
		}
	}
	else
	{
		if (mHighlighted)
		{
			Darken();
		}
	}
	return retval;
}



////////////////////////////////////////////////
// Button_WaitOneTurn
//
// Update: Checks if any subsystems are damaged and updates its state
// Render: Renders text to wait one turn
// Mouseover: Highlights button (if active)
// Click: Sends message to client to wait one turn
// Activates on: any Subsystem damaged
// Deactivates on: all subsystems repaired
// Darkens on: No mouseover
// Highlights on: Mouseover
///////////////////////////////////////////////
Button_WaitOneTurn::Button_WaitOneTurn(SpaceShooterClient* game, ButtonType id, float xLeft, float xRight, float yTop, float yBottom, int w, int h, LPCSTR texLit, LPCSTR texUnlit, ID3DXSprite* sprite, ID3DXFont* font)
	: MenuButton(id, xLeft, xRight, yTop, yBottom, w, h,texLit, texUnlit, sprite, font)
{
	mGame = game;
	sprintf_s(mTextBuffer, "End Turn");
}

Button_WaitOneTurn::~Button_WaitOneTurn(void)
{

}

bool Button_WaitOneTurn::Update(POINT mousepos, bool buttonDown)
{
	bool retval = false;
	// check all subsystems
	PlayerInformation info = mGame->GetPlayerInfo();

	if (info.turnsUntilRepairBlaster > 0	||
		info.turnsUntilRepairHyperdrive > 0	||
		info.turnsUntilRepairLRS > 0		||
		info.turnsUntilRepairMissiles > 0	||
		info.turnsUntilRepairShields > 0	||
		info.turnsUntilRepairSublight > 0)
	{
		if (!mActivated)
		{
			Activate();
		}
		else
		{
			if (IsMouseOver(mousepos))
			{
				retval = true;
				if (!mHighlighted)
				{
					Highlight();
				}

				if (buttonDown)
				{
					mGame->Event(MSGTYPE_INPUT_WAIT_ONE_TURN);
				}
			}
			else
			{
				if (mHighlighted)
				{
					Darken();
				}
			}
		}
	}
	else
	{
		if (mActivated)
		{
			Deactivate();
		}
	}
	return retval;
}


////////////////////////////////////////////////
// Button_GalaxyMap
//
// Update: Checks if hyperdrive is damaged and current state of game map
// Render: Renders text to Hyperdrive
// Mouseover: Highlights button (if active)
// Click: Sends message to client to wait one turn
// Activates on: Nothing
// Deactivates on: Nothing
// Darkens on: No mouseover
// Highlights on: Mouseover
///////////////////////////////////////////////
Button_GalaxyMap::Button_GalaxyMap(SpaceShooterClient* game, ButtonType id, float xLeft, float xRight, float yTop, float yBottom, int w, int h, LPCSTR texLit, LPCSTR texUnlit, ID3DXSprite* sprite, ID3DXFont* font)
	: MenuButton(id, xLeft, xRight, yTop, yBottom, w, h,texLit, texUnlit, sprite, font)
{
	mGame = game;
	sprintf_s(mTextBuffer, "Hyperdrive");
}

Button_GalaxyMap::~Button_GalaxyMap(void)
{

}

bool Button_GalaxyMap::Update(POINT mousepos, bool buttonDown)
{
	bool retval = false;

	// check if the hyperdrive is damaged
	PlayerInformation info = mGame->GetPlayerInfo();
	if (info.turnsUntilRepairHyperdrive > 0)
	{
		sprintf_s(mTextBuffer, "Hyperdrive Damaged\n%i turns", info.turnsUntilRepairHyperdrive);
		// if the game is in the galaxy map state, set it to the sector map state
		if (mGame->GalaxyMapOpen())
		{
			mGame->CloseGalaxyMap();
		}
	}
	else
	{
		sprintf_s(mTextBuffer, "Hyperdrive");

		if (IsMouseOver(mousepos))
		{
			retval = true;
			if (buttonDown)
			{
				// send a different message to the game based on the current state
				if (mGame->GalaxyMapOpen())
				{
					mGame->CloseGalaxyMap();
				}
				else
				{
					mGame->OpenGalaxyMap();
				}
			}

			if (!mHighlighted)
			{
				Highlight();
			}
		}
		else
		{
			if (mHighlighted)
			{
				Darken();
			}
		}
	}
	return retval;
}


////////////////////////////////////////////////
// Button_SublightDamaged
//
// Update: Checks if sublight is damaged
// Render: Renders text to warn player that the sublight is damaged
// Mouseover: Nothing
// Click: Nothing
// Activates on: Sublight damaged
// Deactivates on: Sublight repaired
// Darkens on: Nothing
// Highlights on: Nothing
///////////////////////////////////////////////
Button_SublightDamaged::Button_SublightDamaged(SpaceShooterClient* game, ButtonType id, float xLeft, float xRight, float yTop, float yBottom, int w, int h, LPCSTR texLit, LPCSTR texUnlit, ID3DXSprite* sprite, ID3DXFont* font)
	: MenuButton(id, xLeft, xRight, yTop, yBottom, w, h,texLit, texUnlit, sprite, font)
{
	mGame = game;
	Darken();
}

Button_SublightDamaged::~Button_SublightDamaged(void)
{

}

bool Button_SublightDamaged::Update(POINT mousepos, bool buttonDown)
{
	PlayerInformation info = mGame->GetPlayerInfo();

	bool retval = false;

	// if repairs need to be completed
	if (info.turnsUntilRepairSublight > 0)
	{
		retval = IsMouseOver(mousepos);
		if (!mActivated)
			Activate();
		// update the text
		sprintf_s(mTextBuffer, "SUBLIGHT DAMAGED\n%i turns", info.turnsUntilRepairSublight);
	}
	else// no repairs are needed
	{
		if (mActivated)
			Deactivate();
	}

	return retval; // no clicking events on this button
}

////////////////////////////////////////////////
// Button_LRSDamaged
//
// Update: Checks if LRS is damaged
// Render: Renders text to warn player that the LRS is damaged
// Mouseover: Nothing
// Click: Nothing
// Activates on: LRS damaged
// Deactivates on: LRS repaired
// Darkens on: Nothing
// Highlights on: Nothing
///////////////////////////////////////////////
Button_LRSDamaged::Button_LRSDamaged(SpaceShooterClient* game, ButtonType id, float xLeft, float xRight, float yTop, float yBottom, int w, int h, LPCSTR texLit, LPCSTR texUnlit, ID3DXSprite* sprite, ID3DXFont* font)
	: MenuButton(id, xLeft, xRight, yTop, yBottom, w, h,texLit, texUnlit, sprite, font)
{
	mGame = game;
	Darken();
}

Button_LRSDamaged::~Button_LRSDamaged(void)
{

}

bool Button_LRSDamaged::Update(POINT mousepos, bool buttonDown)
{
	PlayerInformation info = mGame->GetPlayerInfo();

	bool retval = false;

	// if repairs need to be completed
	if (info.turnsUntilRepairLRS > 0)
	{
		retval = IsMouseOver(mousepos);
		if (!mActivated)
			Activate();
		// update the text
		sprintf_s(mTextBuffer, "LRS DAMAGED\n%i turns", info.turnsUntilRepairLRS);
	}
	else// no repairs are needed
	{
		if (mActivated)
			Deactivate();
	}

	return retval; // no clicking events on this button
}

////////////////////////////////////////////////
// Button_FireBlasters
//
// Update: Nothing
// Render: Renders "Fire Blasters"
// Mouseover: Highlights button
// Click: Sends message to client to fire blasters (which sends message to server)
// Activates on: Repaired blasters
// Deactivates on: Damaged blasters
// Darkens on: no mouseover
// Highlights on: mouseover
///////////////////////////////////////////////
Button_FireBlasters::Button_FireBlasters(SpaceShooterClient* game, ButtonType id, float xLeft, float xRight, float yTop, float yBottom, int w, int h, LPCSTR texLit, LPCSTR texUnlit, ID3DXSprite* sprite, ID3DXFont* font)
	: MenuButton(id, xLeft, xRight, yTop, yBottom, w, h,texLit, texUnlit, sprite, font)
{
	mGame = game;
	sprintf_s(mTextBuffer, "Fire Blasters");
}

Button_FireBlasters::~Button_FireBlasters(void)
{

}

bool Button_FireBlasters::Update(POINT mousepos, bool buttonDown)
{
	bool retval = false;

	PlayerInformation info = mGame->GetPlayerInfo();

	if (info.turnsUntilRepairBlaster > 0)
	{
		if (mActivated)
		{
			Deactivate();
		}
	}

	if (info.turnsUntilRepairBlaster <= 0)
	{
		if (!mActivated)
		{
			Activate();
		}
	}

	if (IsMouseOver(mousepos))
	{
		retval = true;
		if (buttonDown)
		{
			mGame->Event(MSGTYPE_INPUT_FIRE_BLASTERS);
		}
		Highlight();
	}
	else
	{
		Darken();
	}	
	return retval;

}